


function extend(sub, sup) {
  sub.prototype = Object.create(sup.prototype);
  Object.defineProperty(sub.prototype, "constructor", {
    value: sub,
    enumerable: false
  });
}




function User(name, age) {
  this.name = name;
  this.age = age;
}
User.prototype.show = function() {
  console.log(this.name, this.age);
};
function Admin(...args) {
  User.apply(this, args);
}
extend(Admin, User);
let admin = new Admin("向军", 19);
admin.show();


function Member(...args) {
  User.apply(this, args);
}
extend(Member, User);
let member = new Member("李四", 23);
member.show();



